﻿#pragma execution_character_set("utf-8")
// 本文件为utf-8 编码格式

#include "RoundImageViewController.h"
#include "../GdDefine.h"
#include "../Util/GDUtil.h"
#include "../Base/GDRoundImageView.h"

RoundImageViewController::RoundImageViewController(void)
{
}


RoundImageViewController::~RoundImageViewController(void)
{
}

bool RoundImageViewController::init(){
	if (!CAViewController::init()){
		return false;
	}
	return true;
}

void RoundImageViewController::viewDidLoad(){
	CCSize winSize = this->getView()->getBounds().size;

	this->getView()->addSubview(GDUtil::createLabelWithFrame(CCRect(0, 0, winSize.width, _px(40)), "原图", CAColor_black, _px(24), "", CATextAlignmentCenter, CAVerticalTextAlignmentCenter));

	CAImageView *imageView = CAImageView::createWithCenter(CCRect(winSize.width / 2, _px(160), _px(200), _px(200)));
	imageView->setImage(CAImage::create(GD_IMAGE_PATH + "head.jpg"));
	this->getView()->addSubview(imageView);

	this->getView()->addSubview(GDUtil::createLabelWithFrame(CCRect(_px(0), _px(300), winSize.width, _px(40)), "圆形图片", CAColor_black, _px(24), "", CATextAlignmentCenter, CAVerticalTextAlignmentCenter));

	GDRoundImageView *roundImage = GDRoundImageView::createWithFrame(CCRect((winSize.width-_px(200)) / 2, _px(360), _px(200), _px(200)));
	roundImage->setImage(CAImage::create(GD_IMAGE_PATH + "head.jpg"));
	this->getView()->addSubview(roundImage);
}
void RoundImageViewController::viewDidUnload(){

}
void RoundImageViewController::viewDidAppear(){

}
void RoundImageViewController::viewDidDisappear(){

}